/*
 * AABB.cpp
 *
 *  Created on: 16 mars 2011
 *      Author: seeme
 */

#include "AABB.h"

void AABB::draw(){
	//Used only for debugging.
	glEnableClientState(GL_VERTEX_ARRAY);
	GLfloat verts[] = { m_lower.x, m_lower.y, m_lower.z,
						m_upper.x, m_lower.y, m_lower.z,
						m_upper.x, m_upper.y, m_upper.z,
						m_lower.x, m_upper.y, m_lower.z,
						m_lower.x, m_upper.y, m_lower.z+m_width,
						m_lower.x, m_lower.y, m_lower.z+m_width,
						m_upper.x, m_lower.y, m_lower.z+m_width,
						m_upper.x, m_upper.y, m_lower.z+m_width};

	GLubyte indices[] = {0,1,2,3,
	                     2,7,6,1,
						 7,4,5,6,
						 4,5,0,3,
						 3,2,7,4,
						 6,5,0,1};


	glVertexPointer(3, GL_FLOAT, 0, verts);

	glColor3f(1.0f, 1.0f, 1.0f);
	glDrawElements(GL_QUADS, 24, GL_UNSIGNED_BYTE, indices);

	glDisableClientState(GL_VERTEX_ARRAY);
}
